<!DOCTYPE html>
<html>
<head>
	<title>报表</title>
	<meta charset="utf-8">
	<link rel="shortcut icon" href="favicon.ico">
	<link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/css/font-awesome.css" rel="stylesheet">
    <link href="__STATIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__STATIC__/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="__STATIC__/xinli/css/history.css">
	<style type="text/css">
		.memu>span>a{
			 color: yellow;
		}
		.middle-line1-content{
	        width: 99%;
		    background-color: rgba(182, 171, 171, 0.56);
		    font-size: 12px;
		    border: 1px solid rgba(128, 128, 128, 0.72);
		    border-radius: 5px;
		    margin: 0 auto;
		    margin-top: 8px;
		}
		.middle-line1-content>div{
			 margin-top: 3px;
    		padding: 6px 0 6px 13px;
		}
		.table-or{
			background-color: rgba(219, 81, 4, 0.78);
		    color: white;
		    font-size: 12px;
	        text-align: center;
    		width: 20%;	
		}
		.middle-form-content{
			width: 60%;
		}
		select{
			padding: 2px;
		    padding-bottom: 6px;
		}
		.buttons{
			display: inline-block;
		}
		.buttons>span{
			padding: 5px;
			margin-left: 2px;
			border:1px solid gray;
			border-radius: 3px;
		}
		.selectss{
			display: inline-block;
			    padding: 0 10px 0 60px;
		}
		input{
		    width: 125px;
	        padding-left: 7px;
		}
		.font-red{
			color: red;
			margin-left: 10%;
		}
		.boton{
		    text-align: center;	
		    width: 100%;
		}
		.boton>span{
		     border: 1px solid rgb(3, 169, 244);
		    padding: 3px 6px;
		    border-radius: 3px;
		    color: black;
		    margin-left: 5px;
		    cursor: pointer;
		}
		.form-size{
		    margin: 7px;
    		border: 1px solid rgba(128, 128, 128, 0.29);
    		padding: 6px;
		}

		.buttons>span{
			cursor: pointer;
		}
	</style>
</head>
<body>
	<div>
		<div class="heads">
			<div class="poly">保利</div>
			<div style="clear: both;"></div>

		<div style="position: relative;width: 80%;float: right;">
			<div class="arrow-left"></div>
			<div class="memus" style="height: 30px;">
				<div class="bevel"></div>
				<div style="clear: both;"></div>
		{switch name=":session('usertype')"}
    {case value="1"}
				<span><a href="{:url('admin/home/plate')}">开封盘</a></span>
				<span><a href="{:url('admin/home/oddstema')}">赔率设置</a></span>
				<span><a href="{:url('admin/Single/injection')}">即时注单</a></span>
				<span><a href="{:url('admin/home/replenishment')}">补货</a></span>
				<span><a href="{:url('admin/home/director')}">总监</a></span>
				<span><a href="{:url('admin/home/bigshareholders')}">大股东</a></span>
				<span><a href="{:url('admin/home/shareholders')}">股东</a></span>
				<span><a href="{:url('admin/home/bigangent')}">总代理</a></span>
				<span><a href="{:url('admin/home/angent')}">代理</a></span>
				<span><a href="{:url('admin/home/members')}">会员</a></span>
				<!-- <span><a href="{:url('admin/home/Traders')}">操盘员</a></span> -->
				<span><a href="{:url('admin/home/system')}">系统配置</a></span>
				<span><a href="{:url('admin/home/Notice')}">公告</a></span>
				<span><a href="{:url('admin/home/notecheck')}">注单查询</a></span>
				<span><a href="{:url('admin/home/red')}">报表</a></span>
				<span><a href="{:url('admin/home/fot')}">客服</a></span>
				<span><a href="{:url('admin/home/Onlinepersonnel')}">在线人员</a></span>
				<span><a href="{:url('admin/login/logout')}">登出</a></span>
    {/case}
    {case value="2"}
    		{switch name=":session('roots')"}
    		 {case value="0"}
				<span><a href="{:url('admin/Single/injection')}">即时注单</a></span>
				<span><a href="{:url('admin/home/replenishment')}">补货</a></span>
				<span><a href="{:url('admin/home/bigshareholders')}">大股东</a></span>
				<span><a href="{:url('admin/home/shareholders')}">股东</a></span>
				<span><a href="{:url('admin/home/bigangent')}">总代理</a></span>
				<span><a href="{:url('admin/home/angent')}">代理</a></span>
				<span><a href="{:url('admin/home/members')}">会员</a></span>
				<span><a href="{:url('admin/home/notecheck')}">注单查询</a></span>
				<span><a href="{:url('admin/home/red')}">报表</a></span>
				<span><a href="{:url('admin/home/Onlinepersonnel')}">在线人员</a></span>
				<span><a href="{:url('admin/login/logout')}">登出</a></span>
				 {/case}
				{case value="1"}
				<span><a href="{:url('admin/home/plate')}">开封盘</a></span>
				<span><a href="{:url('admin/home/oddstema')}">赔率设置</a></span>
				<span><a href="{:url('admin/Single/injection')}">即时注单</a></span>
				<span><a href="{:url('admin/home/replenishment')}">补货</a></span>
				<span><a href="{:url('admin/home/bigshareholders')}">大股东</a></span>
				<span><a href="{:url('admin/home/shareholders')}">股东</a></span>
				<span><a href="{:url('admin/home/bigangent')}">总代理</a></span>
				<span><a href="{:url('admin/home/angent')}">代理</a></span>
				<span><a href="{:url('admin/home/members')}">会员</a></span>
				<!-- <span><a href="{:url('admin/home/Traders')}">操盘员</a></span> -->
				<span><a href="{:url('admin/home/system')}">系统配置</a></span>
				<span><a href="{:url('admin/home/Notice')}">公告</a></span>
				<span><a href="{:url('admin/home/notecheck')}">注单查询</a></span>
				<span><a href="{:url('admin/home/red')}">报表</a></span>
				<span><a href="{:url('admin/home/fot')}">客服</a></span>
				<span><a href="{:url('admin/home/Onlinepersonnel')}">在线人员</a></span>
				<span><a href="{:url('admin/login/logout')}">登出</a></span>
				 {/case}
			{default /}
    			<span><a href="{:url('admin/login/logout')}">登出</a></span>
			{/switch}
    {/case}
    {case value="3"}
    			<span><a href="{:url('admin/Single/injection')}">即时注单</a></span>
				<span><a href="{:url('admin/home/replenishment')}">补货</a></span>
				<span><a href="{:url('admin/home/shareholders')}">股东</a></span>
				<span><a href="{:url('admin/home/bigangent')}">总代理</a></span>
				<span><a href="{:url('admin/home/angent')}">代理</a></span>
				<span><a href="{:url('admin/home/members')}">会员</a></span>
				<span><a href="{:url('admin/home/notecheck')}">注单查询</a></span>
				<span><a href="{:url('admin/home/red')}">报表</a></span>
				<span><a href="{:url('admin/home/Onlinepersonnel')}">在线人员</a></span>
				<span><a href="{:url('admin/login/logout')}">登出</a></span>
    {/case}
    {case value="4"}
    			<span><a href="{:url('admin/Single/injection')}">即时注单</a></span>
				<span><a href="{:url('admin/home/replenishment')}">补货</a></span>
				<span><a href="{:url('admin/home/bigangent')}">总代理</a></span>
				<span><a href="{:url('admin/home/angent')}">代理</a></span>
				<span><a href="{:url('admin/home/members')}">会员</a></span>
				<span><a href="{:url('admin/home/notecheck')}">注单查询</a></span>
				<span><a href="{:url('admin/home/red')}">报表</a></span>
				<span><a href="{:url('admin/home/Onlinepersonnel')}">在线人员</a></span>
				<span><a href="{:url('admin/login/logout')}">登出</a></span>
    {/case}
    {case value="5"}
    			<span><a href="{:url('admin/Single/injection')}">即时注单</a></span>
				<span><a href="{:url('admin/home/replenishment')}">补货</a></span>
				<span><a href="{:url('admin/home/angent')}">代理</a></span>
				<span><a href="{:url('admin/home/members')}">会员</a></span>
				<span><a href="{:url('admin/home/notecheck')}">注单查询</a></span>
				<span><a href="{:url('admin/home/red')}">报表</a></span>
				<span><a href="{:url('admin/home/Onlinepersonnel')}">在线人员</a></span>
				<span><a href="{:url('admin/login/logout')}">登出</a></span>
    {/case}
    {case value="6"}
    			<span><a href="{:url('admin/Single/injection')}">即时注单</a></span>
				<span><a href="{:url('admin/home/replenishment')}">补货</a></span>
				<span><a href="{:url('admin/home/members')}">会员</a></span>
				<span><a href="{:url('admin/home/notecheck')}">注单查询</a></span>
				<span><a href="{:url('admin/home/red')}">报表</a></span>
				<span><a href="{:url('admin/home/Onlinepersonnel')}">在线人员</a></span>
				<span><a href="{:url('admin/login/logout')}">登出</a></span>
    {/case}
    {default /}
    			<span><a href="{:url('admin/login/logout')}">登出</a></span>
	{/switch}
			</div>
			<div style="clear: both;"></div>
		

		<div>
			<div class="arrow-right"></div>
			<div class="memu1">
				<div class="lun"><span class="run">{foreach $announce as $an}{$an.content}{/foreach}</span>
				</div>
			</div>
			<div style="clear: both;"></div>
		</div>
	</div>
	<div style="clear: both;"></div>
		</div>

		<div class="middle">
			<div class="middle-line1-content">
				<div>报表管理</div>
			</div>
			<div class="middle-form-content">
				<form action="{:url('admin/toji/summary')}" method="post"  class="form-size" name="cha">
					<table class="table table-striped">
	                    <tbody>
	                        <tr>
	                            <td class="table-or">报表类型</td>
	                            <td>
	                            	<select name="redtype" id="chax">
	                            	<option value="zong">总账</option>
	                            	<option value="fen">分类账</option>
		                            </select>
		                            <div class="buttons">
	                            		<span data-type="1">本星期</span>
			                            <span data-type="2">上星期</span>
			                            <span data-type="3">本月</span>
			                            <span data-type="4">本上月</span>
			                            <span data-type="5">最近一期</span>
		                            </div>
		                        </td>
	                            
	                        </tr>
	                        <tr>
	                            <td class="table-or">日期区间</td>
	                            <td>
	                            		<input type="date" name="stime" value="">~
		                           		<input type="date" name="etime" value="">

	                            </td>
	                           
	                        </tr>
	                        <tr>
	                            <td  class="table-or">投注方式</td>
	                            <td>
		                            <div class="selectss">
		                            	<select name="reddata1">
		                            		<option disabled="disabled" SELECTED>选择结束期数</option>
		                            		<?php
		                            			for($i=$min;$i<=$max;$i++){
		                            		?>
			                            	<option>{$i}</option>
			                            	<?php
			                            		}
			                            	?>
		                           		 </select>~
		                           		<select name="reddata2">
			                            	<option disabled="disabled" SELECTED>选择结束期数</option>
			                            	<?php
		                            			for($i=$min;$i<=$max;$i++){
		                            		?>
			                            	<option>{$i}</option>
			                            	<?php
			                            		}
			                            	?>
		                           	</select>
		                            </div>
		                            
	                            </td>
	                           
	                        </tr>
	                        <tr>
	                            <td  class="table-or">投注种类</td>
	                            <td>
	                            	<select name="redmold">
	                            	<option value="0">全部</option>
	                            	<option value="1">特码B</option>
	                            	<option value="2">特码A</option>
	                            	<option value="3">特码单双</option>
	                            	<option value="4">特码大小</option>
	                            	<option value="5">特码合码单双</option>
	                            	<option value="6">正码</option>
	                            	<option value="7">总和单双</option>
	                            	<option value="8">总和大小</option>
	                            	<option value="9">特码色波</option>
	                            	<option value="10">特码生肖</option>
	                            	<option value="11">正码1-6单双</option>
	                            	<option value="12">正码1-6大小</option>
	                            	<option value="13">正码1-6色波</option>
	                            	<option value="14">正码1-6合单双</option>
	                            	<option value="15">半波</option>
	                            	<option value="16">多肖</option>
	                            	<option value="17">一肖[中]</option>
	                            	<option value="18">尾数</option>
	                            	<option value="19">三全中</option>
	                            	<option value="20">三中二</option>
	                            	<option value="21">二全中</option>
	                            	<option value="22">二中特</option>
	                            	<option value="23">特串</option>
	                            	<option value="24">七色波</option>
	                            	<option value="25">正码特</option>
	                            	<option value="26">特码合码大小</option>
	                            	<option value="27">特码尾数大小</option>
	                            	<option value="28">特码半特</option>
	                            	<option value="29">特码头数</option>
	                            	<option value="30">特码尾数</option>
	                            	<option value="31">总肖</option>
	                            	<option value="32">总肖单双</option>
	                            	<option value="33">正肖</option>
	                            	<option value="34">连肖</option>
	                            	<option value="35">正码过关</option>
	                            	<option value="36">5不中</option>
	                            	<option value="37">6不中</option>
	                            	<option value="38">7不中</option>
	                            	<option value="39">8不中</option>
	                            	<option value="40">9不中</option>
	                            	<option value="41">10不中</option>
	                            	<option value="42">11不中</option>
	                            	<option value="43">12不中</option>
	                            	<option value="44">3中一</option>
	                            	<option value="45">4中一</option>
	                            	<option value="46">5中一</option>
	                            	<option value="47">6中一</option>
	                            	<option value="48">一肖[不中]</option>
	                            	<option value="49">尾数连</option>
	                            	<option value="50">七码</option>
		                            </select>
	                            </td>
	                        </tr>
	                    </tbody>
	                </table>
	                <div class="boton">
	                	<input type="submit" id="chaxun" value="查询">
	                	<input type="reset"  value="取消">
	                </div>
                </form>
			</div>
		</div>
	</div>
	<!-- 全局js -->
    <script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
    	<!-- 自定义JS -->
	<script src="__STATIC__/js/admin/controtiren.js"></script>
  <script type="text/javascript">
  	 $(function(){
  	 	$(".buttons>span[data-type=5]").click(function(){

  	 	})
           		 $("#jinyong").each(function () {
                	$(this).attr("disabled","disabled");
           	 });
        	});

  		function change(){
     			document.getElementById("chax")[fen].selected=true;
		}

  		 $("#chax").change(function(){
  			 	// console.log($(this).val());
			    	var cha = $(this).val();
			    	if(cha == "zong"){
			    		$("form[name=cha]").attr("action","{:url('admin/toji/summary')}")
			    	}else{
			    		$("form[name=cha]").attr("action","{:url('admin/toji/index')}")
			    	}
    	})

  		$(function(){ 
				var timestamp = Date.parse(new Date());
				$("input[name=stime]").attr('value',fmtDate(timestamp));
				$("input[name=etime]").attr('value',fmtDate(timestamp)); 
				   
			})
  		function fmtDate(obj){
			    var date =  new Date(obj);
			    var y = 1900+date.getYear();
			    var m = "0"+(date.getMonth()+1);
			    var d = "0"+date.getDate();
			    return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length);
			}
			$('.buttons').find('span').click(function(){
				var n = $(this).attr('data-type');
				// console.log(n)
				if(n==1){
					// 本本周
					var now = new Date(); 
					var nowTime = now.getTime() ; 
					var day = now.getDay();
					var oneDayLong = 24*60*60*1000 ; 

					var MondayTime = nowTime - (day-1)*oneDayLong  ; 
					var SundayTime =  nowTime + (7-day)*oneDayLong ; 
					$("input[name=stime]").val(fmtDate(MondayTime));
					$("input[name=etime]").val(fmtDate(SundayTime));
					// console.log(fmtDate(MondayTime),fmtDate(SundayTime)); 
				}
				if(n==2){
					// 上周
					var now = new Date;
			        var day = now.getDay ();
			        var week = "7123456";
			        var first = 0 - week.indexOf (day);
			        var f = new Date;
			        f.setDate (f.getDate () + first-6);
			        var last = 6 - week.indexOf (day);
			        var l = new Date;
			        l.setDate (l.getDate () + last-6);
			        $("input[name=stime]").val(fmtDate(f));
					$("input[name=etime]").val(fmtDate(l));
				}
				if(n==3){
					var firstDate = new Date();
					firstDate.setDate(1); //第一天
					var endDate = new Date(firstDate);
					endDate.setMonth(firstDate.getMonth()+1);
					endDate.setDate(0);
					$("input[name=stime]").val(fmtDate(firstDate));
					$("input[name=etime]").val(fmtDate(endDate));
				// console.log(fmtDate(firstDate),fmtDate(endDate))
				}
				if(n==4){
					var nowdays = new Date();  
					var year = nowdays.getFullYear();  
					var month = nowdays.getMonth();  
					if(month==0)  
					{  
					    month=12;  
					    year=year-1;  
					}  
					if (month < 10) {  
					    month = "0" + month;  
					}  
					var firstDay = year + "-" + month + "-" + "01";//上个月的第一天  
					var myDate = new Date(year, month, 0);  
					var lastDay = year + "-" + month + "-" + myDate.getDate();//上个月的最后一天  
					// console.log(firstDay,lastDay);
					$("input[name=stime]").val(firstDay);
					$("input[name=etime]").val(lastDay);
				}

			})
			function fmtDate(obj){
			    var date =  new Date(obj);
			    var y = 1900+date.getYear();
			    var m = "0"+(date.getMonth()+1);
			    var d = "0"+date.getDate();
			    return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length);
			}



			//公告轮播
    		$(function(){
			var price = 0
			//轮播
			var left = 0;
			function move(){
				left--
				if (left < -$(".run").width()) {
					left = 0
				}
				$(".run").css("left",left+"px")
			}
			setInterval(move,60)
		})
			
  </script>


</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>